/**
 * Represents a single square on the Sudoku grid.
 * @author Kat.Winter
 */
public class Square {
	
	/**
	 * Represents the number in the square
	 */
	private int value;
	/**
	 * Represents the section of the grid that this square is found in
	 */
	private int section;
	/**
	 * Indicates if this square has a permanent initial value or not
	 */	
	private boolean permanent = false;
	
	/**
	 * Constructor to set the default value to 0.
	 */
	public Square() {
		
		value = 0;
	}
	
	/**
	 * Sets the value in this square to whatever number gets passed in.
	 * That will the the permanent value, so the "changeable" variable
	 * also gets set to false.
	 * @param val  Number to be the value in the square
	 */
	public void setPermValue(int val) {
		
		permanent = true;
		value = val;
	}
	
	/**
	 * Assigns the "section" variable to the number representing the
	 * section that this square is found in.
	 * @param section  Number of the section this square is found in
	 */
	public void setSection(int section) {
		
		this.section = section;
	}
	
	/**
	 * Updates this square's value to be the number passed into the method.
	 * @param guess  Number to be assigned as this square's value
	 */
	public void addValue(int guess) {
		
		value = guess;
	}
	
	/**
	 * Returns whether or not this square has a value which can be changed.
	 * @return  True or False, can the value of this square be changed
	 */
	public boolean isPermanent() {
		
		return permanent;
	}
	
	/**
	 * Getter for the value for this square.
	 * @return  Number held by this square
	 */
	public int getValue() {
		
		return value;
	}
	
	/**
	 * Getter the section to which this square belongs.
	 * @return  Section this square is found in
	 */
	public int getSection() {
		
		return section;
	}
}
